//
//  InstituDetailViewController.m
//  ShangHaiTuJI
//
//  Created by xiaoxiangtuji on 2017/9/11.
//  Copyright © 2017年 xiaoxiangtuji. All rights reserved.
//

#import "InstituDetailViewController.h"
#import "InstituteDetailCell.h"
#import "InstituteModel.h"
#import "CatagoryModel.h"
@interface InstituDetailViewController ()<UITableViewDelegate,UITableViewDataSource>

@property(nonatomic,strong)UITableView *tablview;


@end

@implementation InstituDetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self createtablview];
    // Do any additional setup after loading the view.
}
-(void)createtablview{
    self.tablview = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, WIDTH, HEIGHT - (64 + 40 + scaleTopAndBottom(200))) style:UITableViewStylePlain];
    [self.view addSubview:self.tablview];
    self.tablview.delegate = self;
    self.tablview.dataSource = self;
    self.tablview.tableFooterView = [[UIView alloc] init];
    [self.tablview registerClass:[InstituteDetailCell class] forCellReuseIdentifier:@"InstituteDetailCell"];
    self.tablview.separatorStyle = UITableViewCellSeparatorStyleNone;
    self.tablview.estimatedRowHeight = 200;
    [self.tablview reloadData];
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 1;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return self.dataArray.count;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    InstituteDetailCell *cell = [tableView dequeueReusableCellWithIdentifier:@"InstituteDetailCell"];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    CatagoryModel *model = self.dataArray[indexPath.row];
    [cell.imgeView sd_setImageWithURL:[NSURL URLWithString:model.imgPath] placeholderImage:[UIImage imageNamed:@""]];
    cell.descripLable.text = model.text;
    return cell;
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
